//package com.juyu.miliao.api.controller;
//
//import javax.annotation.Resource;
//
//import com.alibaba.fastjson.JSONObject;
//import org.springframework.security.core.Authentication;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.fasterxml.jackson.annotation.JsonView;
//import com.juyu.miliao.api.domain.UserCount;
//import com.juyu.miliao.api.service.ShareService;
//import com.juyu.miliao.api.util.JacksonView;
//import com.juyu.miliao.common.domain.Subject;
//import com.juyu.miliao.common.exception.IllegalParamException;
//
///**
// * 分享
// *
// * @author wbf
// */
//@RestController
//@RequestMapping("/share")
//public class ShareController {
//	@Resource
//	ShareService shareService;
//
//
////	/**
////	 * 获取用户分享数，获得金币
////	 */
////	@GetMapping("/{userId:^[1-9][0-9]*$}")
////	@JsonView(JacksonView.Share.class)
////	public UserCount getShareAndRewardSumById(@PathVariable("userId") Integer userId) {
////		return shareService.getShareAndRewardSumById(userId);
////	}
////
////	/**
////	 * 输入分享码逻辑 shareUserId 分享用户 inputUserId 输入分享码用户
////	 */
////	@GetMapping("/{shareUserId:^[1-9][0-9]*$}/{inputUserId:^[1-9][0-9]*$}")
////	public void inputShare(Authentication token, @PathVariable("shareUserId") Integer shareUserId,
////			@PathVariable("inputUserId") Integer inputUserId) {
////		Subject subject = (Subject) token.getPrincipal();
////		if (subject.getId() != inputUserId)
////			throw new IllegalParamException("用户id错误");
////		shareService.inputShare(shareUserId, inputUserId);
////	}
////
////	/**
////	 * 用户分享成功，分享数+1
////	 */
////	@GetMapping("/add/{userId:^[1-9][0-9]*$}")
////	public void addShareSum(Authentication token, @PathVariable("userId") Integer userId) {
////		Subject subject = (Subject) token.getPrincipal();
////		if (subject.getId() != userId)
////			throw new IllegalParamException("用户id错误");
////		shareService.addShareSum(userId);
////	}
//}
